<?php


namespace app\app\controller;


use app\constant\UploadConst;
use app\helper\OssHelper;
use app\model\AdminSiteConfig;
use app\model\AdminTenantConfig;

class Site extends Base
{
    public function getSiteView()
    {
        $data = AdminSiteConfig::get($this->addTid([]))->getData();
        return $this->buildSuccess($data);
    }
    public function getTenantConfig(){
        $model = (new AdminTenantConfig())->get($this->addTid([]));
        $config = [];
        if($model){
            $config = $model->getData();
        }
        $oss = OssHelper::getOssConfig(UploadConst::OSS,$this->getUserTid());
        $config['baseImgUrl'] = $oss['host'];
        return $this->buildSuccess($config);
    }
}